<template>
  <div id="borrowDetail">
    <div class="homeTitle">同业拆借交易详情</div>
    <div class="tableBox">
      <div class="table">
        <!-- -------------------------------------------------------- -->
        <div class="tableTitle">申请人信息</div>
        <table>
          <tr>
            <td>机构编号</td> <td>{{user.no}}</td>
            <td>机构名称</td> <td>{{user.bank}}</td>
          </tr>
          <tr>
            <td>操作员工号</td> <td>{{user.jobNum}}</td>
            <td>操作员姓名</td> <td>{{user.name}}</td>
          </tr>
        </table>
        <div class="tableTitle">交易对手：</div>
        <table>
          <tr>
            <td>交易对手</td> <td>{{counterparty.full}}</td>
            <td>交易机构类型</td> <td>{{counterparty.type}}</td>
          </tr>
          <tr>
            <td>业务类型</td> <td>{{account.type}}</td>
            <td>开户行</td> <td>{{account.openBank}}</td>
          </tr>
          <tr>
            <td>账户名称</td> <td>{{account.accountName}}</td>
            <td>账号</td> <td>{{account.number}}</td>
          </tr>
          <tr>
            <td>支付系统行号</td> <td>{{account.payment}}</td>
            <td>托管机构</td> <td>{{account.trusteeship}}</td>
          </tr>
          <tr>
            <td>托管账户名称</td> <td>{{account.trusteeshipAccountName}}</td>
            <td>托管账号</td> <td>{{account.managedAccount}}</td>
          </tr>
        </table>
 <!-- -------------------------------------------------------- -->
        <div class="tableTitle">交易信息：</div>
        <table>
          <tr>
            <td>申请编号</td> <td>{{interHold.applyNum}}</td>
            <td>申请日期</td> <td>{{interHold.createTime | dateformat}}</td>
          </tr>
          <tr>
            <td>拆借类型</td> <td>{{interHold.type}}</td>
            <td>币种</td> <td>{{interHold.currency}}</td>
          </tr>
          <tr>
            <td>交易方式</td> <td>{{interHold.transactionMode}}</td>
            <td>首次结算日</td> <td>{{interHold.firstSettlementDate | dateformat}}</td>
          </tr>
          <tr>
            <td>拆借期限（日）</td> <td>{{interHold.lendingPeriod}}</td>
            <td>到期还款日</td> <td>{{interHold.payDay | dateformat}}</td>
          </tr>
          <tr>
            <td>清算速度</td> <td>{{interHold.clearingSpeed}}</td>
            <td>顺延利率（%）</td> <td>{{interHold.interestRate}}</td>
          </tr>
          <tr>
            <td>实际占款天数（天）</td> <td>{{interHold.actualDays}}</td>
            <td>计息基础</td> <td>{{interHold.countBasis}}</td>
          </tr>
          <tr>
            <td>结息方式</td> <td>{{interHold.bearingMethod}}</td>
            <td>结息频率</td> <td>{{interHold.interestFrequency}}</td>
          </tr>
          <tr>
            <td>应收\付利息（元）</td> <td>{{interHold.interestReceivable}}</td>
            <td>到期还\付款金额(元)</td> <td>{{interHold.amountDue}}</td>
          </tr>
          <tr>
            <td>成交编号/td> <td>{{interHold.transactionNumber}}</td>
            <td>成交日期</td> <td>{{interHold.closingDate | dateformat}}</td>
          </tr>
          <tr>
            <td>拆借金额（元）/td> <td>{{interHold.loanAmount}}</td>
            <td>成交利率（%）</td> <td>{{interHold.transactionRate}}</td>
          </tr>
        </table>
      </div>
      <div class="btn">
        <el-button type="primary" size="small" @click="close">关闭</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'borrowDetail',
  data () {
    return {
      account: '',
      counterparty: '',
      interHold: '',
      user: ''
    };
  },
  mounted () {
    this.getdata();
  },
  methods: {
    getdata () {
      this.axios.get('interbankLendingHold/selectOne',{params: {id: this.$route.query.id}})
        .then(({data})=> {
          this.account = data.data.account;
          this.counterparty= data.data.counterparty;
          this.interHold = data.data.interHold;
          this.user = data.data.user;
        })
    },
    close () {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="scss">
  #borrowDetail {
    .tableBox {
      padding-top: 10;
      color: white;
      .tableTitle {
        line-height: 36px;
        padding-left: 20px;
      }
      table {
        border: 1px solid white;
        width: 100%;
        text-align: center;
        border-collapse:collapse;
        margin-bottom: 20px;
        tr {
          td {
            padding: 5px 10px;
            border-right: 1px solid white;
            border-bottom: 1px solid white;
            &:nth-child(odd) {
              background:#2F3638;
            }
            &:nth-child(even) {
              background: #646E6E;
            }
          }
        }
      }
      .btn {
        text-align: center;
      }
    }
  }
</style>
